
#if !defined(_SPREADORDER_HELPER_H_H)
#define _SPREADORDER_HELPER_H_H

namespace GSTrader
{
	namespace TradeStrategy
	{
		class COrderHelper
		{
		public:
			COrderHelper();
			virtual ~COrderHelper();
			bool IsDone();
			void SetDone();

		protected:
			bool m_bDone;
		};

		class CSellSideOrderHelper : public COrderHelper
		{
		public:
			CSellSideOrderHelper(CSellSideInstrumentStragegyImpl* pStrategy, CExecutionCommond* pExecutionCommond);
			~CSellSideOrderHelper();

		public:
			virtual void OnNewMarketData(CDepthMarketData* pMarketData);
			virtual void OnExecutionReport(CExecutionReport* pReport);

		private:
			COrder* m_pOrder;
			CExecutionCommond* m_pExecutionCommond;
			CSellSideInstrumentStragegyImpl* m_pStrategy;
		};

		class CSpreadOrderHelper : public COrderHelper
		{
		public:
			CSpreadOrderHelper(CSpreadInstrumentStrategyImpl* pStrategy);
			virtual ~CSpreadOrderHelper();

		public:
			virtual void OnNewMarketData(CDepthMarketData* pMarketData);
			virtual void OnExecutionReport(CExecutionReport* pReport);

		private:
			CSpreadInstrumentStrategyImpl* m_pStrategy;

			vector<COrder*> m_vLegOrder;
			int m_nLegCount;
			bool* m_pComplate;
		};
	}
}

#endif // _SPREADORDER_HELPER_H_H
